package com.nuanshui.heatedloan.credit.facade;

import com.nuanshui.heatedloan.credit.constant.CalculateLoanAmtResponse;
import com.nuanshui.heatedloan.credit.form.PayOrderInfoForm;
import com.nuanshui.heatedloan.credit.pay.PayInformPara;
import com.nuanshui.heatedloan.credit.pay.PayResult;
import com.nuanshui.heatedloan.credit.response.*;
import com.nuanshui.heatedloan.credit.vo.CustomerBankCardInfoVO;
import com.nuanshui.heatedloan.credit.vo.PayOrderInfoVO;

/**
 * Created by wangxw on 2017/7/12.
 */
public interface ApplyOrderService {

    /***
     * 单期贷首页
     * @param userId
     * @return
     */
    SingleLoanPageResponse getSingleLoanPageData(String userId);

    /***
     * 获取闪电贷首页
     * @param userId
     * @return
     */
    LightLoanPageResponse getLightLoanPageData(String userId);

    /***
     *
     * @param type
     * @param userId
     * @return
     */
    OrderResponse getZeroDays(int type, String userId);

    /***
     * 生成订单
     * @param payOrderInfoForm
     * @param smsCode
     * @return
     */
    OrderResponse placeOrder(PayOrderInfoForm payOrderInfoForm, String smsCode, String phone);

    /***
     *
     * @param payOrderInfoForm
     * @return
     */
    CalculateLoanAmtResponse calculateLoanAmt(PayOrderInfoForm payOrderInfoForm);

    /***
     * 风控回调时候参数的处理  提交订单时候
     * @param applyLoanResponse
     */
    void callBackRisk(ApplyLoanResponse applyLoanResponse);

    /***
     * 确定按钮提交调用风控
     * @param payOrderInfoForm
     * @param
     * @param payOrderInfoForm
     */
    boolean confirmOrderRisk(PayOrderInfoForm payOrderInfoForm);

    /***
     * 风控确认订单的回调地址
     * @param applyLoanResponse
     */
    void sendMqFromRiskConfirmOrder(ApplyLoanResponse applyLoanResponse);


    /***
     * 风控确认订单的回调地址
     * @param raiseLimitResponse
     */
    void sendMqFromRaiseLimit(RaiseLimitResponse raiseLimitResponse);

    /***
     * 订单放款成功之后的启动定时任务
     * @param payOrderInfo
     */
    void startQuartz(PayOrderInfoVO payOrderInfo);


    /***
     *支付或者或者还
     */
    public void dealPayAfter(PayInformPara payInformPara);

    /***
     * 开始发送支付的消息队列
     * @param applyLoanResponse
     */
    public void playMoney(ApplyLoanResponse applyLoanResponse);


    /***
     * 还款的逻辑
     * @param payOrderInfoVO
     * @param mixCardNo
     * @return
     */
    public PayResult repayMoney(PayOrderInfoVO payOrderInfoVO,String mixCardNo);

    /***
     * 获取用户的还卡的信息，并放在redis中
     * @param payOrderInfoVO
     * @param mixCard
     * @return
     */
    public CustomerBankCardInfoVO getRepayCardInfo(PayOrderInfoVO payOrderInfoVO,String mixCard,String transCode);

}
